<!DOCTYPE html>
<html>
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<link rel="icon" href="/logo.ico" type="image/x-icon"/>
		<link href="/css/bootstrap.min.css" rel="stylesheet">
        <link href="/css/style.css" rel="stylesheet">
		<script src="/js/axios.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/sweetalert.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/sha256.js" type="text/javascript" charset="utf-8"></script>
        <script src="https://unpkg.com/@lottiefiles/lottie-player@1.3.1/dist/lottie-player.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/common.js" type="text/javascript" charset="utf-8"></script>
        <style>
            iframe{border:0;}
        </style>
    </head>
    <body>
        <img src="logo/logo.png" align="center" style="width:300px;height:75px;"><br>
        <center>
            <div style="width:80%;">
                <lottie-player id="lottie-player" src="/lottie/lock.json" background="transparent" speed="1" style="width: 65%; height: 65%; margin:auto;" loop autoplay></lottie-player>
                <br>
                <div class="input-group mb-3">
                    <button class="btn btn-outline-secondary" onclick="javascript:swal({'text':'￥{LanguageCode:1001}￥','icon':'info'});">
                        <svg t="1597981492955" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9186" width="20" height="20"><path d="M512 127.9c51.9 0 102.2 10.1 149.5 30.2 45.7 19.3 86.8 47 122.1 82.3s63 76.4 82.3 122.1c20 47.3 30.2 97.6 30.2 149.5S886 614.2 865.9 661.5c-19.3 45.7-47 86.8-82.3 122.1s-76.4 63-122.1 82.3c-47.3 20-97.6 30.2-149.5 30.2S409.8 886 362.5 865.9c-45.7-19.3-86.8-47-122.1-82.3s-63-76.4-82.3-122.1c-20-47.3-30.2-97.6-30.2-149.5s10.1-102.2 30.2-149.5c19.3-45.7 47-86.8 82.3-122.1s76.4-63 122.1-82.3c47.3-20 97.6-30.2 149.5-30.2m0-64C264.5 63.9 63.9 264.5 63.9 512S264.5 960.1 512 960.1 960.1 759.5 960.1 512 759.5 63.9 512 63.9z" fill="" p-id="9187"></path><path d="M480 736h64v64h-64zM476.9 686.3c-0.3-9.3-0.4-42.2-0.4-46.8 0-27.3 3.9-50.8 11.6-70.6 5.7-14.9 14.8-30 27.4-45.1 9.3-11.1 25.9-27.2 50-48.4 24-21.2 39.7-38.1 46.9-50.7s10.8-26.4 10.8-41.3c0-27-10.5-50.7-31.6-71.2-21.1-20.4-46.9-30.7-77.5-30.7-29.6 0-54.3 9.3-74.1 27.8-19.8 18.5-32.8 47.4-39 86.8l-71.4-8.5c6.4-52.7 25.5-93.1 57.3-121.1s73.7-42 125.9-42c55.3 0 99.4 15 132.3 45.1 32.9 30.1 49.4 66.5 49.4 109.2 0 24.7-5.8 47.4-17.4 68.3s-34.2 46.2-67.9 76c-22.6 20.1-37.4 34.8-44.4 44.4-6.9 9.5-12.1 20.4-15.4 32.8-3.3 12.3-5.3 58.4-5.8 86.2h-66.7v-0.2z" fill="" p-id="9188"></path></svg>
                    </button>
                    <input id="token-input" type="password" class="form-control" placeholder="￥{LanguageCode:1002}￥" style="width:40%;">
                    <button type="button" class="btn btn-outline-success" onclick="javascript:commit()">￥{LanguageCode:1003}￥</button>
                </div>
            </div>
        </center>
        <script>
            var handle_flag=false;
            async function commit()
            {
                token=document.getElementById("token-input").value;
                try
                {
                    const response = await axios.post("/rg?token="+sha256_digest(token));
                    console.log(response);
                    if(response.status==200)
                    {
                        var go_url=GetQueryString("go_url");
                        if(go_url==null)
                        {
                            window.location.href="/tree";
                        }
                        else
                        {
                            window.location.href=decodeURIComponent(go_url);
                        }
                    }
                }
                catch(err)
                {
                    try
                    {
                        const response = await axios.post("/rg?token="+token);
                        console.log(response);
                        if(response.status==200)
                        {
                            var go_url=GetQueryString("go_url");
                            if(go_url==null)
                            {
                                window.location.href="/tree";
                            }
                            else
                            {
                                window.location.href=decodeURIComponent(go_url);
                            }
                        }
                    }
                    catch(err)
                    {
                        handle_flag=true;
                        await swal({"text":"￥{LanguageCode:1004}￥","icon":"error"});
                        handle_flag=false;
                    }
                }
            }
			document.onkeydown=function(key)
			{
				if(key.code=="Enter")
				{
					if(handle_flag==true)
					{
					    return true;
					}
					commit();
					return false;
				}
				return true;
			}
        </script>
        <script src="/js/bootstrap.bundle.min.js"></script>
    </body>
</html>